[id].vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. <template>
  2. <!-- 页面头部 -->
  3. <HomePageHead></HomePageHead>
  4. <!-- 导航栏 -->
  5. <HomePageNavigation1></HomePageNavigation1>
  6. <!-- Banner1 -->
  7. <HomeBanner1></HomeBanner1>
  8. <!-- 面包屑导航 -->
  9. <div class="breadcrumb">
  10. <div class="inner">
  11. <span class="location">当前位置:</span>
  12. <el-breadcrumb :separator-icon="ArrowRight">
  13. <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
  14. <el-breadcrumb-item :to="{ path: `/primaryNavigation/${listid}` }" v-show="name">{{ name
  15. }}</el-breadcrumb-item>
  16. <el-breadcrumb-item>{{ newsDetail.con_title }}</el-breadcrumb-item>
  17. </el-breadcrumb>
  18. </div>
  19. </div>
  20. <!-- 资讯列表 -->
  21. <div class="newsDetail">
  22. <div class="inner">
  23. <div class="innerLeft">
  24. <div class="leftBottomTitle">{{ newsDetail.con_title }}</div>
  25. <div class="leftBottom" v-html="newsDetail.content" v-if="newsDetail.content"></div>
  26. </div>
  27. <div class="innerRight">
  28. <div class="rightMenuTitle">导航列表</div>
  29. <ul>
  30. <li v-for="(item, index) in bottomMenu" :key="index">
  31. <NuxtLink :to="`/speciaArticle/${item.id}`" target="_blank" :title="item.name"
  32. v-if="item.id == pageId && item.id != 7" class="active">
  33. {{ item.name }}
  34. </NuxtLink>
  35. <NuxtLink :to="`/speciaArticle/${item.id}`" target="_blank" :title="item.name"
  36. v-else-if="item.id != pageId && item.id != 7">
  37. {{ item.name }}
  38. </NuxtLink>
  39. <NuxtLink :to="`/specialList/${item.id}`" target="_blank" :title="item.name"
  40. v-if="item.id == 7 && pageId == 7 && routeHref == '/specialList/7'" class="active">
  41. {{item.name }}
  42. </NuxtLink>
  43. <NuxtLink :to="`/specialList/${item.id}`" target="_blank" :title="item.name" v-else-if="item.id == 7">
  44. {{ item.name}}
  45. </NuxtLink>
  46. </li>
  47. </ul>
  48. </div>
  49. <div style="clear: both;"></div>
  50. </div>
  51. </div>
  52. <!-- 页面底部 -->
  53. <HomeFoot1></HomeFoot1>
  54. </template>
  55. <script setup>
  56. //1.页面依赖 start ---------------------------------------->
  57. import { ElBreadcrumb, ElBreadcrumbItem } from 'element-plus'
  58. import { ArrowRight } from '@element-plus/icons-vue'
  59. //获得跳转过来的id
  60. const route = useRoute();
  61. const articleId = route.params.id; //获得该页面的id
  62. const listid = route.query.listId; //获得该页面的id
  63. const name = route.query.listName; //获得该页面的id
  64. const pageId = route.params.id; //获得该页面的id
  65. const routeHref = route.href;
  66. //1.页面依赖 end ---------------------------------------->
  67. //2.页面数据 start ---------------------------------------->
  68. const newsDetail = ref({})
  69. const bottomMenu = ref([]);
  70. async function getPageData() {
  71. const { data: mkdata, error: mkdataError } = requestData('/web/getWebsiteFooterCategoryInfo', {
  72. method: 'GET',
  73. query: {
  74. 'fcat_id': articleId
  75. },
  76. });
  77. if (mkdataError.value) {
  78. //console.log()
  79. } else {
  80. if (mkdata.value) {
  81. newsDetail.value = mkdata.value.data;
  82. console.log(101010)
  83. console.log(newsDetail.value)
  84. }
  85. }
  86. }
  87. getPageData();
  88. async function getPageMenu() {
  89. const { data: mkdata, error: mkdataError } = requestData('/web/getWebsiteFooterCategory', {
  90. method: 'GET',
  91. query: {},
  92. });
  93. if (mkdataError.value) {
  94. //console.log()
  95. } else {
  96. if (mkdata.value) {
  97. bottomMenu.value = mkdata.value.data;
  98. }
  99. }
  100. }
  101. getPageMenu();
  102. //2.3 获得广告
  103. let adList = ref([]);
  104. const {data:adData,error:adError} = requestData('/web/getWebsiteFooterCategory',{method:'GET',query:{'ad_tag':'page'}});
  105. if (adError.value) {
  106. console.error('广告列表请求失败:', adError.value);
  107. } else {
  108. //当有值了以后再放进去,万恶之源,也是nuxt2和3都存在的一个问题,也许nuxt4会解决这个问题
  109. if (adData.value && adData.value.data) {
  110. adList.value = adData.value.data;
  111. console.log(adData.value.data)
  112. }
  113. }
  114. //2.页面数据 end ---------------------------------------->
  115. //4.设置seo信息 start---------------------------------------->
  116. //4.1 设置seo信息
  117. const setData = await requestDataPromise('/web/getWebsiteFootInfo', {
  118. method: 'GET',
  119. query: {},
  120. });
  121. let seoTitle = setData.data.website_head.title;
  122. let seoDescription = setData.data.website_head.description;
  123. let seoKeywords = setData.data.website_head.keywords;
  124. useSeoMeta({
  125. title: seoTitle,
  126. meta: [
  127. { name: 'description', content: seoDescription },
  128. { name: 'keywords', content: seoKeywords }
  129. ]
  130. });
  131. //4.设置seo信息 end---------------------------------------->
  132. </script>
  133. <style lang="less" scoped>
  134. //导航条
  135. .breadcrumb {
  136. width: 100%;
  137. height: 22px;
  138. margin-bottom: 30px;
  139. font-family: Microsoft YaHei, Microsoft YaHei;
  140. font-weight: 400;
  141. font-size: 20px;
  142. color: #666666;
  143. line-height: 23px;
  144. text-align: left;
  145. font-style: normal;
  146. text-transform: none;
  147. .el-breadcrumb::v-deep {
  148. display: inline-block;
  149. vertical-align: -4px;
  150. }
  151. /deep/.el-breadcrumb__inner a,
  152. /deep/.el-breadcrumb__inner.is-link {
  153. color: #666666;
  154. font-weight: 400;
  155. text-decoration: none;
  156. transition: var(--el-transition-color);
  157. }
  158. span {
  159. font-family: Microsoft YaHei, Microsoft YaHei;
  160. font-weight: 400;
  161. font-size: 20px;
  162. color: #666666;
  163. line-height: 23px;
  164. text-align: left;
  165. font-style: normal;
  166. text-transform: none;
  167. }
  168. span:hover {
  169. color: #666666;
  170. }
  171. .location {
  172. margin-right: 20px;
  173. width: 100px;
  174. height: 22px;
  175. font-family: Microsoft YaHei, Microsoft YaHei;
  176. font-weight: 400;
  177. font-size: 20px;
  178. color: #666666;
  179. line-height: 23px;
  180. text-align: left;
  181. font-style: normal;
  182. text-transform: none;
  183. }
  184. }
  185. // 资讯列表
  186. .newsDetail {
  187. width: 100%;
  188. //height: 1400px;
  189. margin-bottom: 70px;
  190. .inner {
  191. width: 1200px;
  192. //height: 1400px;
  193. font-size: 16px;
  194. .innerLeft {
  195. //height: 1400px;
  196. float: right;
  197. .LeftTop {
  198. //height: 522px;
  199. margin-top: 50px;
  200. >h1 {
  201. line-height: 40px;
  202. margin-bottom: 30px;
  203. font-family: Microsoft YaHei, Microsoft YaHei;
  204. font-weight: bold;
  205. font-size: 30px;
  206. color: #333333;
  207. }
  208. >p {
  209. height: 18px;
  210. line-height: 18px;
  211. font-family: Microsoft YaHei, Microsoft YaHei;
  212. font-weight: 400;
  213. font-size: 14px;
  214. color: #999999;
  215. span {
  216. margin-right: 40px;
  217. }
  218. }
  219. >img {
  220. width: 680px;
  221. height: 382px;
  222. padding: 50px 0px 60px 55px;
  223. }
  224. }
  225. .leftBottomTitle {
  226. color: #028E21;
  227. font-size: 24px;
  228. font-weight: bold;
  229. height: 60px;
  230. line-height: 60px;
  231. }
  232. .leftBottom {
  233. width: 790px;
  234. font-size: 20px;
  235. border-top: 1px solid #139602;
  236. padding-top: 40px;
  237. >h3,
  238. >p {
  239. text-indent: 2em;
  240. width: 790px;
  241. font-family: Microsoft YaHei, Microsoft YaHei;
  242. font-size: 20px;
  243. color: #333333;
  244. line-height: 23px;
  245. padding-bottom: 30px;
  246. }
  247. >h3 {
  248. font-weight: 600px;
  249. }
  250. >p {
  251. font-weight: 400;
  252. }
  253. }
  254. }
  255. .innerRight {
  256. width: 279px;
  257. .rightMenuTitle {
  258. width: 279px;
  259. height: 69px;
  260. font-size: 22px;
  261. font-weight: bold;
  262. line-height: 58px;
  263. text-align: center;
  264. color: #fff;
  265. background: url("../../public/special/projectMoreTitle.png") no-repeat;
  266. margin-bottom: 30px;
  267. }
  268. ul {
  269. li {
  270. a {
  271. border-left: 5px solid #028E21;
  272. margin-bottom: 15px;
  273. font-size: 22px;
  274. display: block;
  275. height: 61px;
  276. line-height: 61px;
  277. color: #333333;
  278. text-align: center;
  279. background: #FBFBFB;
  280. }
  281. }
  282. }
  283. .active {
  284. border-left: 0;
  285. border: 1px solid #028E21;
  286. background: #fff;
  287. }
  288. }
  289. }
  290. }
  291. </style>